home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 May: Tool Chest / Dev.CD May 98 TC.toast / Tool Chest / Networking / MacTCP / MPing 1.1 / Sources / MPing.h < prev    next >
Encoding:
C/C++ Source or Header  |  1991-09-30  |  7.2 KB  |  207 lines  |  [TEXT/MPS ]

  1. /*------------------------------------------------------------------------------
  2. #    MPing 1.1 - MacTCP Ping Tool
  3. #
  4. #    Copyright © Apple Computer, Inc. 1990-1991
  5. #    All rights reserved.
  6. #
  7. #    Versions:    
  8. #                1.1        September 25, 1991.
  9. #
  10. #    File:
  11. #                MPing.c
  12. #
  13. #    Components:
  14. #                AddressXlation.h
  15. #                MacTCPCommonTypes.h
  16. #                Makefile
  17. #                MiscIPPB.h
  18. #                MPing.c
  19. #                MPing.h
  20. #                MPing.r
  21. #                MPingDlg.c
  22. #                MPingExtern.h
  23. #                MPingGlobals.h
  24. #                MPingIcmp.c
  25. #                MPingWindow.c
  26. #                resolver.c
  27. ------------------------------------------------------------------------------*/
  28.  
  29. #define kMinSize    128                /* application's minimum size (in K) */
  30.  
  31. #define kPrefSize    256                /* application's preferred size (in K) */
  32.  
  33. #define    rMenuBar    128                /* application's menu bar */
  34. #define    rAboutAlert    128                /* about alert */
  35. #define    rUserAlert    129                /* error user alert */
  36. #define    rDialog        130                /* application's window/dialog */
  37. #define rVScroll    128                /* vertical scroll bar controls */
  38. #define rMsgRect    128                /* rectangle for ICMP message box */
  39.  
  40. /* kSysEnvironsVersion is passed to SysEnvirons to tell it which version of the
  41.    SysEnvRec we understand. */
  42.  
  43. #define    kSysEnvironsVersion        1
  44.  
  45. /* kOSEvent is the event number of the suspend/resume and mouse-moved events sent
  46.    by MultiFinder. Once we determine that an event is an osEvent, we look at the
  47.    high byte of the message sent to determine which kind it is. To differentiate
  48.    suspend and resume events we check the resumeMask bit. */
  49.  
  50. #define    kOSEvent                app4Evt    /* event used by MultiFinder */
  51. #define    kSuspendResumeMessage    1        /* high byte of suspend/resume event message */
  52. #define    kResumeMask                1        /* bit of message field for resume vs. suspend */
  53. #define    kMouseMovedMessage        0xFA    /* high byte of mouse-moved event message */
  54. #define    kNoEvents                0        /* no events mask */
  55.  
  56. /* The following constants are used to identify menus and their items. The menu IDs
  57.    have an "m" prefix and the item numbers within each menu have an "i" prefix. */
  58.  
  59. #define    mApple                    128        /* Apple menu */
  60. #define    iAbout                    1
  61.  
  62. #define    mFile                    129        /* File menu */
  63. #define    iNew                    1
  64. #define    iClose                    4
  65. #define    iQuit                    12
  66.  
  67. #define    mEdit                    130        /* Edit menu */
  68. #define    iUndo                    1
  69. #define    iCut                    3
  70. #define    iCopy                    4
  71. #define    iPaste                    5
  72. #define    iClear                    6
  73.  
  74. #define mIPOptions                131        /* IP options menu */
  75. #define iRecordRoute            1
  76. #define    iLooseSourceRR            2
  77. #define iStrictSourceRR            3
  78. #define    iTimeStamp                4
  79. #define    iSecurity                5
  80. #define    iStreamID                6
  81.  
  82. /*    1.01 - kTopLeft - This is for positioning the Disk Initialization dialogs. */
  83.  
  84. #define kDITop                    0x0050
  85. #define kDILeft                    0x0070
  86.  
  87. /*    1.01 - kMinHeap - This is the minimum result from the following
  88.     equation:
  89.         
  90.         ORD(GetApplLimit) - ORD(ApplicZone)
  91.         
  92.     for the application to run. It will insure that enough memory will
  93.     be around for reasonable-sized scraps, FKEYs, etc. to exist with the
  94.     application, and still give the application some 'breathing room'.
  95.     To derive this number, we ran under a MultiFinder partition that was
  96.     our requested minimum size, as given in the 'SIZE' resource. 29*1024 */
  97.      
  98. #define kMinHeap                29 * 1024
  99.     
  100. /*    1.01 - kMinSpace - This is the minimum result from PurgeSpace, when called
  101.     at initialization time, for the application to run. This number acts
  102.     as a double-check to insure that there really is enough memory for the
  103.     application to run, including what has been taken up already by
  104.     pre-loaded resources, the scrap, code, and other sundry memory blocks. */
  105.      
  106. #define kMinSpace                20 * 1024
  107.  
  108. /* kExtremeNeg and kExtremePos are used to set up wide open rectangles and regions. */
  109.  
  110. #define kExtremeNeg                -32768
  111. #define kExtremePos                32767 - 1 /* required to address an old region bug */
  112.  
  113. /* these #defines are used to set enable/disable flags of a menu */
  114.  
  115. #define AllItems    0b1111111111111111111111111111111    /* 31 flags */
  116. #define NoItems        0b0000000000000000000000000000000
  117. #define MenuItem1    0b0000000000000000000000000000001
  118. #define MenuItem2    0b0000000000000000000000000000010
  119. #define MenuItem3    0b0000000000000000000000000000100
  120. #define MenuItem4    0b0000000000000000000000000001000
  121. #define MenuItem5    0b0000000000000000000000000010000
  122. #define MenuItem6    0b0000000000000000000000000100000
  123. #define MenuItem7    0b0000000000000000000000001000000
  124. #define MenuItem8    0b0000000000000000000000010000000
  125. #define MenuItem9    0b0000000000000000000000100000000
  126. #define MenuItem10    0b0000000000000000000001000000000
  127. #define MenuItem11    0b0000000000000000000010000000000
  128. #define MenuItem12    0b0000000000000000000100000000000
  129.  
  130.  
  131.  
  132. /* 1.01 - changed constants to begin with 'k' for consistency, except for resource IDs */
  133. /*    kTextMargin is the number of pixels we leave blank at the edge of the window. */
  134. #define kTextMargin                2
  135.  
  136. /*    kMaxDocWidth is an arbitrary number used to specify the width of the TERec's
  137.     destination rectangle so that word wrap and horizontal scrolling can be
  138.     demonstrated. */
  139. #define    kMaxDocWidth            60
  140.  
  141. /*    kControlInvisible is used to 'turn off' controls (i.e., cause the control not
  142.     to be redrawn as a result of some Control Manager call such as SetCtlValue)
  143.     by being put into the contrlVis field of the record. kControlVisible is used
  144.     the same way to 'turn on' the control. */
  145. #define kControlInvisible        0
  146. #define kControlVisible            0xFF
  147.  
  148. /*    kScrollbarAdjust and kScrollbarWidth are used in calculating
  149.     values for control positioning and sizing. */
  150. #define kScrollbarWidth            16
  151. #define kScrollbarAdjust        (kScrollbarWidth - 1)
  152.  
  153. /*    kScrollTweek compensates for off-by-one requirements of the scrollbars
  154.  to have borders coincide with the growbox. */
  155. #define kScrollTweek            2
  156.     
  157. /*    kCrChar is used to match with a carriage return when calculating the
  158.     number of lines in the TextEdit record. kDelChar is used to check for
  159.     delete in keyDowns. */
  160. #define kCrChar                    13
  161. #define kDelChar                8
  162.     
  163. /*    kButtonScroll is how many pixels to scroll horizontally when the button part
  164.     of the horizontal scrollbar is pressed. */
  165. #define kButtonScroll            4
  166.     
  167. /*    kMaxTELength is an arbitrary number used to limit the length of text in the TERec
  168.     so that various errors won't occur from too many characters in the text. */
  169. #define    kMaxTELength            32000
  170.  
  171. /*    kExtremeNeg and kExtremePos are used to set up wide open rectangles and regions. */
  172. #define kExtremeNeg                -32768
  173. #define kExtremePos                (32767 - 1)    /* required to address an old region bug */
  174.     
  175. /* kTESlop provides some extra security when pre-flighting edit commands. */
  176. #define    kTESlop                    1024
  177.  
  178. /* String constant indexes for STR# resource */
  179.  
  180. #define rErrorStrings        128
  181.  
  182. #define sPingHeader            1
  183. #define sPingTail            sPingHeader+1
  184. #define sPktInfo            sPingTail+1
  185. #define sTimeInfo            sPktInfo+1
  186. #define sResolverErr        sTimeInfo+1
  187. #define sExceedChar            sResolverErr+1
  188. #define sWrongMachine        sExceedChar+1
  189. #define sAppMemSmall        sWrongMachine+1
  190. #define sNoWindow            sAppMemSmall+1
  191. #define sNoRectRes            sNoWindow+1
  192. #define sNoTERes            sNoRectRes+1
  193. #define sNoVScrollBar        sNoTERes+1
  194. #define sNoMenuBar            sNoVScrollBar+1
  195. #define sHostNotResp        sNoMenuBar+1
  196. #define sRecordedRoute        sHostNotResp+1
  197. #define sNoRoutesRecorded    sRecordedRoute+1
  198. #define sWaitValWrong        sNoRoutesRecorded+1
  199. #define sSuccessPktStatus    sWaitValWrong+1
  200. #define sTimeoutPktStatus    sSuccessPktStatus+1
  201. #define sSourceAddress        sTimeoutPktStatus+1
  202. #define sDestinationAddress    sSourceAddress+1
  203.  
  204. /* Cursor animation during ping */
  205. #define gFirstCuror        128
  206. #define gLastCursor        131
  207.